package com.wc.AlgoOJ_train.train3_算法大礼包.c3_贪心.AG0408_蜂蜜工厂;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.Comparator;
import java.util.PriorityQueue;
import java.util.StringTokenizer;

/**
 * @Author congge
 * @Date 2024/3/15 16:28
 * @description http://43.138.190.70:8888/p/AG0408
 */
public class Main {
    static FastReader sc = new FastReader();
    static PrintWriter out = new PrintWriter(System.out);
    static int N = 10010;
    static int[] a = new int[N];
    static int[] b = new int[N];
    static int n, s;

    public static void main(String[] args) {
        n = sc.nextInt();
        s = sc.nextInt();
        for (int i = 1; i <= n; i++) {
            a[i] = sc.nextInt();
            b[i] = sc.nextInt();
        }
        long res = 0;
        PriorityQueue<Pair> q = new PriorityQueue<>(Comparator.comparingInt(o -> o.x));
        for (int i = 1; i <= n; i++) {
            // 存的是单价
            q.add(new Pair(a[i] + (n - i + 1) * s, i));
//            long minV = (long) a[i] * b[i];
//            for (int j = 1; j < i; j++) {
//                minV = Math.min((long) a[j] * b[i] + (long) (i - j) * s * b[i], minV);
//            }
            int price = a[q.peek().y] + (i - q.peek().y) * s;
            res += (long) price * b[i];
        }
        System.out.println(res);
    }

    static class Pair implements Comparable<Pair> {
        int x, y;

        Pair(int x, int y) {
            this.x = x;
            this.y = y;
        }

        @Override
        public int compareTo(Pair o) {
            if (x == o.x) {
                return y - o.y;
            }
            return x - o.x;
        }
    }
}

class FastReader {
    StringTokenizer st;
    BufferedReader br;

    FastReader() {
        br = new BufferedReader(new InputStreamReader(System.in));
    }

    String next() {
        while (st == null || !st.hasMoreElements()) {
            try {
                st = new StringTokenizer(br.readLine());
            } catch (IOException e) {
                e.printStackTrace();
            }
        }
        return st.nextToken();
    }

    int nextInt() {
        return Integer.parseInt(next());
    }

    String nextLine() {
        String s = "";
        try {
            s = br.readLine();
        } catch (IOException e) {
            e.printStackTrace();
        }
        return s;
    }

    long nextLong() {
        return Long.parseLong(next());
    }

    double nextDouble() {
        return Double.parseDouble(next());
    }

    // 是否由下一个
    boolean hasNext() {
        while (st == null || !st.hasMoreTokens()) {
            try {
                String line = br.readLine();
                if (line == null)
                    return false;
                st = new StringTokenizer(line);
            } catch (IOException e) {
                throw new RuntimeException(e);
            }
        }
        return true;
    }
}
